package com.infore.airsupervise.http;

import com.infore.airsupervise.app.Constants;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.HeaderMap;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * http请求服务的接口（依赖ResponseBean）
 *
 * @author: dingxinlin
 * @date: 2016-11-24 09:13
 */

public interface HttpService {

    /*
     * POST请求
     */
    @FormUrlEncoded
    @POST
    Call<BaseResponse> postParams(
            @Url String url,
            @FieldMap Map<String, Object> params);

    /*
     * 文件上传
     */
    @Multipart
    @POST
    Call<BaseResponse> postFiles(
            @Url String url,
            @Part List<MultipartBody.Part> files,
            @Part List<MultipartBody.Part> params);

    /*
     * GET请求
     */
    @GET
    Call<BaseResponse> getParams(
            @Url String url,
            @QueryMap Map<String, Object> params);
    /*
    文件下载
     */
    @GET
    Call<ResponseBody> downloadFile(@Url String fileUrl);
}
